<html>
<head>
    <title>智能图书平台</title>
    <meta charset="UTF-8">
    <style>
        * {
            box-sizing: border-box;
            font-family: Arial, sans-serif;
        }

        @keyframes animatedBackground {
            0% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0% 50%;
            }
        }


        body {
            background-size: 400% 400%;
            animation: animatedBackground 20s ease infinite;
            background: linear-gradient(135deg, #83a4d4, #b6fbff);
            margin: 0;
            padding: 0;
            width: 1400px
        }

        nav {
            width: 1439px
        }

        .book-container {
            background-size: cover;
            max-width: 1200px;
            margin: 5% auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            margin-bottom: 20px;
        }

        a {
            text-decoration: none;
            color: #007bff;
        }

        a:hover {
            text-decoration: underline;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th, td {
            padding: 10px;
            text-align: left;
            border: 1px solid #ccc;
        }

        th {
            background-color: #f0f2f5;
        }

        button {
            padding: 5px 10px;
            background-color: #dc3545;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
        }

        button:hover {
            background-color: #c82333;
        }

        form {
            display: inline;
        }

        .edit-btn {
            padding: 5px 10px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            text-decoration: none;
            display: inline-block;
            margin-right: 10px;
        }

        .edit-btn:hover {
            background-color: #0056b3;
        }

        .add-book {
            display: inline-block;
            padding: 5px 10px;
            background-color: #28a745;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            margin-bottom: 20px;
        }

        .add-book:hover {
            background-color: #218838;
        }

        .admin-info {
            text-align: left;
        }

        .center-text {
            position: fixed;
            bottom: 15px; /* 根据需要调整 */
            left: 50%;
            transform: translate(-50%, 50%);
            color: black;
            font-size: 15px;
        }

        td {
            max-width: 50px; /* 设置最大宽度，根据需要调整 */
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .gl {
            text-align: right
        }

        .bb {

            color: red;
        }

        .navbar-right {
            display: flex;
            align-items: center;
        }

        .navbar-brand,
        .bb {
            margin-left: 10px;
            margin-right: 10px;
            color: #fff;
            font-size: 16px;
        }

        .logout-btn {
            background-color: #dc3545;
            color: #fff;
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            margin-left: 10px;
        }

        .logout-btn:hover {
            background-color: #c82333;
        }


    </style>
    <link rel="stylesheet" href="static/comon0.css">
    <script src="{{url_for('static',filename='jquery.js')}}"></script>
    <link href="{{url_for('static',filename='bootstrap.min.css')}}" rel="stylesheet">
    <script src="{{url_for('static',filename='bootstrap.min.js')}}"></script>
</head>
<body>

<nav class="navbar navbar-inverse">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">智能图书平台后台</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

            <ul class="nav navbar-nav navbar-right">
                {% if current_user.is_authenticated %}
                <li>
                    <b class="bb"> 管理员:{{username}}</b>
                    <button class="logout-btn" onclick="window.location.href='{{ url_for('main_index') }}'">注销
                    </button>

                </li>
                {% endif %}
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="row">

    <div class="col-md-2">
        <div class="list-group">
            <a href="#" class="list-group-item active" onclick="fun1()">图书列表</a>
            <a href="#" class="list-group-item" onclick="fun2()">录入新书</a>
        </div>
    </div>

    <iframe src="{{url_for('ind')}}" width="1180px" height="660px" frameborder="0" scrolling="0" id="ifme">

    </iframe>
</div>
<script>
    function fun1() {
        var url = document.getElementById("ifme");
        url.src = '{{url_for('index2')}}'
    }

    function fun2() {
        var url = document.getElementById("ifme");
        url.src = '{{url_for('add_book')}}'
    }

</script>

</body>
</html>